package com.ruoyi.app.controller;

import com.ruoyi.activeinfo.domain.ActiveInfo;
import com.ruoyi.activeinfo.service.IActiveInfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 社区活动Controller
 * 
 * @author hct
 * @date 2022-02-16
 */
@RestController
@RequestMapping("/app/public/active")
public class AppActiveInfoController extends BaseController
{
    @Autowired
    private IActiveInfoService activeInfoService;
    /**
     * 查询社区活动列表
     */
    @GetMapping("index")
    public TableDataInfo index(ActiveInfo activeInfo)
    {
        startPage();
        List<ActiveInfo> list = activeInfoService.selectActiveInfoList(activeInfo);
        return getDataTable(list);
    }
    /**
     * 查询社区活动列表
     */
    @GetMapping("/list")
    public TableDataInfo list(ActiveInfo activeInfo)
    {
        startPage();
        List<ActiveInfo> list = activeInfoService.selectActiveInfoList(activeInfo);
        return getDataTable(list);
    }



    /**
     * 获取社区活动详细信息
     */
    @GetMapping(value = "/detail/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(activeInfoService.selectActiveInfoById(id));
    }

    }
